package twoD.IsoPfem.math;

/**
 * A function f: [-1, 1]^2 -> R where [-1, 1]^2 is the unit square.
 * 
 * @author Matthias Baitsch
 */
public interface FunctionR2ToR {

	/**
	 * Computes the gradient [df/dxi1, df/dxi2]^T.
	 * 
	 * @param xi1
	 *            first coordinate
	 * @param xi2
	 *            second coordinate
	 * @return gradient (array of length 2)
	 */
	public double[] gradientAt(double xi1, double xi2);

	/**
	 * Computes the function value at the specified point.
	 * 
	 * @param xi1
	 *            first coordinate
	 * @param xi2
	 *            second coordinate
	 * @return functions value
	 */
	public double valueAt(double xi1, double xi2);
}
